package com.zeng.jiudian.servlet.front;

import com.alibaba.fastjson.JSONObject;
import com.zeng.jiudian.bean.HotelModel;
import com.zeng.jiudian.service.HotelService;
import com.zeng.jiudian.service.impl.HotelServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author JJ_yo
 * @Date 2020/8/10 - 13:59
 */
@WebServlet("/foot")
public class FootServlet extends HttpServlet
{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
    {
        HotelService hotelService = new HotelServiceImpl();
        HotelModel model = hotelService.getAll();

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("model", model);
        resp.getWriter().println(jsonObject);
    }
}
